<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/dongxing/consumer/Consumer.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/dongxing/consumer/Consumer.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '用户列表',
                name: 'consumer/Consumer',
                url: "/Consumer/",
                sortName: "Id"
            });
            const editFormFields = ref({"UserName":"","NickName":"","Password":""});
            const editFormOptions = ref([[{"title":"用户名","required":true,"field":"UserName","type":"text"}],
                              [{"title":"昵称","field":"NickName","type":"text"}],
                              [{"title":"登录密码","required":true,"field":"Password","type":"password"}]]);
            const searchFormFields = ref({"UserName":"","NickName":"","CreateTime":""});
            const searchFormOptions = ref([[{"title":"用户名","field":"UserName","type":"like"},{"title":"昵称","field":"NickName","type":"like"},{"title":"创建时间","field":"CreateTime","type":"datetime"}]]);
            const columns = ref([{field:'Id',title:'Id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'UserName',title:'用户名',type:'string',link:true,width:110,require:true,align:'left',sort:true},
                       {field:'NickName',title:'昵称',type:'string',width:110,align:'left'},
                       {field:'Password',title:'登录密码',type:'string',width:180,hidden:true,require:true,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Token',title:'Token',type:'string',width:220,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
